import Vue from 'vue';
import Router from 'vue-router';
import IndexPage from '@/pages/index/index';
import articleTypes from '@/pages/articleTypes';
import ArticleDetailPage from '@/pages/articleDetail/articleDetail';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/index',
            name: 'Index',
            component: IndexPage,
            children: [
                {
                    path: 'articleDetail',
                    component: ArticleDetailPage
                }
            ]
        },
        {
            path: '/articleTypes/:types',
            name: 'articleTypes',
            component: articleTypes,
            children: [
                {
                    path: 'articleDetail',
                    component: ArticleDetailPage

                }
            ]
        },
        {
            path: '/',
            redirect: '/index'
        }
    ]
});
